package jdklearn.collectionAndMap.map;

/**
 * author Veng Su
 * email  1344114844@qq.com
 * date   18-9-1 下午4:09
 */
import java.util.*;
//有序的hashmap
public class TestLinkedHashMap
{
    public static void main(String[] args)
    {
        LinkedHashMap scores = new LinkedHashMap();
        scores.put("语文" , 80);
        scores.put("英文" , 82);
        scores.put("数学" , 76);
        //遍历scores里的所有的key-value对
        for (Object key : scores.keySet())
        {
            System.out.println(key + "------>" + scores.get(key));
        }

        HashMap scores1 = new HashMap();
        scores1.put("语文" , 80);
        scores1.put("英文" , 82);
        scores1.put("数学" , 76);
        //遍历scores里的所有的key-value对
        for (Object key : scores1.keySet())
        {
            System.out.println(key + "------>" + scores1.get(key));
        }
    }
}